package com.zyh.homework.test6;

import java.util.ArrayList;

/**
 * @Author zyh
 * @Date 2024/7/30
 * @Description TODO
 */
public class Test6 {
    public static void main(String[] args) {
        ArrayList<Integer> list=new ArrayList<>();
        list.add(1);
        list.add(2);
        list.add(3);
        list.add(4);
        list.add(2);
        list.add(5);
        list.add(2);
        list.add(6);
        // 反转
        MyArrays.reverse(list);
        //求最大值
        Integer max = MyArrays.max(list);
        System.out.println("max = " + max);
//        求最小值
        Integer min = MyArrays.min(list);
        System.out.println("min = " + min);
//        找3在集合中的索引
        int index = MyArrays.indexOf(list, 3);
        System.out.println("index = " + index);
//        将集合中所有元素替换为新元素
        MyArrays.replaceAll(list,2,200);
        System.out.println("list = " + list);
    }
}
